Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error state to icpSwapUsdPricesStore #5953

Merged
merged 1 commit into from
Dec 9, 2024
Merged

Conversation

dskloetd
Copy link
Contributor

@dskloetd dskloetd commented Dec 9, 2024

Motivation

We loaded token prices from ICP Swap.
If this results in an error, we want to show -/- as USD values and show an error state with tooltip.
There can be 2 reasons why there is an error:

  1. Fetching the ICP Swap data fails.
  2. Parsing the ICP Swap data fails.

In this PR we add an extra possible "error" value to the derived store icpSwapUsdPricesStore and use it if parsing the ICP Swap data fails.

Changes

  1. Set icpSwapUsdPricesStore to "error" if there is an error when parsing ICP Swap tickers or if there is an unreasonable value.

Tests

Unit tests added.

Todos

  • Add entry to changelog (if necessary).
    not yet

@dskloetd dskloetd marked this pull request as ready for review December 9, 2024 10:41
@dskloetd dskloetd requested a review from a team as a code owner December 9, 2024 10:41
Copy link
Contributor

@mstrasinskis mstrasinskis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dskloetd dskloetd added this pull request to the merge queue Dec 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 9, 2024
@dskloetd dskloetd force-pushed the kloet/icp-swap-parse-error branch from 299c4b7 to 94ac93b Compare December 9, 2024 12:05
@dskloetd dskloetd enabled auto-merge December 9, 2024 12:05
@dskloetd dskloetd added this pull request to the merge queue Dec 9, 2024
Merged via the queue into main with commit e81d19a Dec 9, 2024
30 checks passed
@dskloetd dskloetd deleted the kloet/icp-swap-parse-error branch December 9, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants